Skip to content

fix: xpath filter passed to 'get_changes'#91

Open
rbu9fe wants to merge 1 commit intosysrepo:masterfrom
rbu9fe:fix/subscription-changes-xpath
Open

fix: xpath filter passed to 'get_changes'#91
rbu9fe wants to merge 1 commit intosysrepo:masterfrom
rbu9fe:fix/subscription-changes-xpath

Conversation

@rbu9fe
Copy link

@rbu9fe rbu9fe commented Nov 11, 2025

When an xpath is set then the sysrepo API already provides only filtered changes. Reapplying the same xpath doesn't work when the filter element is not part of the result. Hence, remove all filters when collecting the changes.

For example, the xpath "/ietf-interfaces:interfaces/interface[type='iana-if-type:ethernetCsmacd']/enabled" subscribes for changes of the 'enabled' leaf but 'type' is not part of the result, in which case get_changes(xpath + '//.', ...) will always be empty!

Hence, we need to remove any filter conditions from the xpath when collecting changes.

@rjarry Can you please review and, if accepted, merge?

When an xpath is set then the sysrepo API already provides only filtered changes. Reapplying the same xpath doesn't work when the filter element is not part of the result. Hence, remove all filters when collecting the changes.

For example, the xpath "/ietf-interfaces:interfaces/interface[type='iana-if-type:ethernetCsmacd']/enabled"
subscribes for changes of the 'enabled' leaf but 'type' is not part of the result, in which case get_changes(xpath + '//.', ...) will always be empty!

Hence, remove any filter conditions from the xpath!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant